'use strict';

stareal
    .controller("CommentController", function ($scope, $stateParams, $api, $state,$lazyLoader,$rootScope,localStorageService) {
       // $scope.comments = new $lazyLoader("app/comment/retrieve", {},true)
        $scope.changeNav=$stateParams.kind;
        console.log($scope.changeNav);
        //他人观演记列表
        $scope.getMoreclassifyli=function(){
            if($scope.changeNav==1){   //观演记
                $scope.goodcomments = new $lazyLoader("app/viewcomment/retrieve",{},true)
            }else if($scope.changeNav==2){ //票务
                $scope.comments = new $lazyLoader("app/comment/retrieve",{},true)
            }else if($scope.changeNav==3){ //活动
                $scope.activtyscomments= new $lazyLoader("app/viewcomment/retrieve",{type:7},true)
            }else if($scope.changeNav==4){ //资讯
                $scope.newscomments= new $lazyLoader("app/viewcomment/retrieve",{type:6},true)
            }else if($scope.changeNav==5){ //视频
                $scope.videoscomments= new $lazyLoader("app/viewcomment/retrieve",{type:5},true)
            }

        }

        $scope.getMoreclassifyli();
        var refresh = function(){
            $state.go('my.comment',{kind:$scope.changeNav},true);
        };
        $scope.navSwitch=function(index){
            $scope.changeNav=index;
            refresh();
        }
    });